//
// Created by Administrator on 2021/5/23.
//

#ifndef NET_SERVER_H
#define NET_SERVER_H

#include "../define.h"
#include "../socket.h"
#include "../event_loop.h"
#include "../buffer.h"

typedef struct {
    aeEventLoop *loop;
    int listen_fd;
    int port;
    int backlog;
    int max_client_count;
    char err_info[ANET_ERR_LEN];
} server_t;

typedef struct {
    aeEventLoop *loop;
    int fd;
    buffer_t *read_buffer;
    buffer_t *write_buffer;
} client_session;

void init_server(server_t *server);
void wait_server(server_t *server);


#endif //NET_SERVER_H
